import { Link } from 'react-router-dom';
import { connect } from 'dva';
import Loadable from 'react-loadable';

const LoadableComponent = Loadable({
    loader: () => import('components/common/bar'),
    loading: () => <div>Loading......</div>,
});

const Page1 = ({ page1 }) => {
    return <div>
        <LoadableComponent />
        <p>{page1.text}</p>
        <Link to="/"><p>Home</p></Link>
        <br/>
        <Link to="/page2"><p>Page 2</p></Link>
    </div>
}

export default connect(({ page1 }) => ({ page1 }))(Page1);